package com.ms.service.module.baccarat.db;

import com.ms.service.module.gamelog.db.GameLogDAO;
import com.xpec.c4.service.module.task.TaskAsyncCommand;
/**
 * 處理關機時先清除上次紀錄，再寫入這次紀錄的ASYNC
 */
public class BacrSaveNewCombosTempToRedisAsync extends TaskAsyncCommand{

	private String key;
	
	private String field;
	
	private String value;
	
	private boolean isDeleteOnly = false;
	
	@Override
	public void asyncExecute() throws Exception {
		if(isDeleteOnly){
			//只做刪掉的部分
			GameLogDAO.deleteDataFromRedis(key);
		}
		else{
			//寫這次的
			GameLogDAO.saveTempToRedis(key, field, value);
		}
	}

	@Override
	public void execute() throws Exception {
		
	}

	public String getKey() {
		return key;
	}

	public void setKey(String key) {
		this.key = key;
	}

	public String getField() {
		return field;
	}

	public void setField(String field) {
		this.field = field;
	}

	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}

	public boolean isDeleteOnly() {
		return isDeleteOnly;
	}

	public void setDeleteOnly(boolean isDeleteOnly) {
		this.isDeleteOnly = isDeleteOnly;
	}

}
